home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / misc / sys / cdefs.h next >
C/C++ Source or Header  |  1993-11-14  |  3KB  |  111 lines

  1. /* Copyright (C) 1992, 1993 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef    _SYS_CDEFS_H
  20.  
  21. #define    _SYS_CDEFS_H    1
  22. #include <features.h>
  23.  
  24. #ifdef __GNUC__
  25.  
  26. #define    __P(args)    args    /* GCC can always grok prototypes.  */
  27. #define    __DOTS        , ...
  28.  
  29. /* In GCC versions before 2.5, the `volatile' and `const' keywords have
  30.    special meanings when applied to functions.  In version 2.5, the
  31.    `__attribute__' syntax used below does not work properly.  */
  32. #if    __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
  33. #define    __NORETURN    __volatile
  34. #define    __CONSTVALUE    __const
  35. #else
  36. /* In GCC 2.6 and later, these keywords are meaningless when applied to
  37.    functions, as ANSI requires.  Instead, we use GCC's special
  38.    `__attribute__' syntax.  */
  39. #define    __NORETURN    __attribute__ ((noreturn))
  40. #define    __CONSTVALUE    __attribute__ ((const))
  41. #endif
  42.  
  43. #else    /* Not GCC.  */
  44.  
  45. #define    __inline        /* No inline functions.  */
  46. #define    __NORETURN        /* No way to say functions never return.  */
  47. #define    __CONSTVALUE        /* No way to say functions are functional.  */
  48.  
  49. #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
  50.  
  51. #define    __P(args)    args
  52. #define    __const        const
  53. #define    __signed    signed
  54. #define    __volatile    volatile
  55. #define    __DOTS        , ...
  56.  
  57. #else    /* Not ANSI C or C++.  */
  58.  
  59. #define    __P(args)    ()    /* No prototypes.  */
  60. #define    __const            /* No ANSI C keywords.  */
  61. #define    __signed
  62. #define    __volatile
  63. #define    __DOTS
  64.  
  65. #endif    /* ANSI C or C++.  */
  66.  
  67. #endif    /* GCC.  */
  68.  
  69. /* For these things, GCC behaves the ANSI way normally,
  70.    and the non-ANSI way under -traditional.  */
  71.  
  72. #if defined (__STDC__) && __STDC__
  73.  
  74. #define    __CONCAT(x,y)    x ## y
  75. #define    __STRING(x)    #x
  76.  
  77. /* This is not a typedef so `const __ptr_t' does the right thing.  */
  78. #define __ptr_t void *
  79. typedef long double __long_double_t;
  80.  
  81. #else
  82.  
  83. #define    __CONCAT(x,y)    x/**/y
  84. #define    __STRING(x)    "x"
  85.  
  86. #define __ptr_t char *
  87. typedef double __long_double_t;
  88.  
  89. #endif
  90.  
  91. /* The BSD header files use the ANSI keywords unmodified.  (This means that
  92.    old programs may lose if they use the new keywords as identifiers.)  We
  93.    define them to their __ versions, which are taken care of above.  */
  94.  
  95. #ifdef    __USE_BSD
  96. #define    const        __const
  97. #define    signed        __signed
  98. #define    volatile    __volatile
  99. #endif
  100.  
  101. /* C++ needs to know that types and declarations are C, not C++.  */
  102. #ifdef    __cplusplus
  103. #define    __BEGIN_DECLS    extern "C" {
  104. #define    __END_DECLS    }
  105. #else
  106. #define    __BEGIN_DECLS
  107. #define    __END_DECLS
  108. #endif
  109.  
  110. #endif     /* sys/cdefs.h */
  111.